package com.xbongbong.saas.service.impl;

import com.xbongbong.paas.redis.PaasRedisHelper;
import com.xbongbong.paas.redis.RedisPrefixConstant;
import com.xbongbong.saas.service.SaleStageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author haibin.zhang
 * @version v1.0
 * @date 2019/2/12 21:45
 * @since v1.0
 */
@Service("saleStageService")
public class SaleStageServiceImpl implements SaleStageService {

    @Resource
    private PaasRedisHelper paasRedisHelper;

    @Override
    public void removeRedis(String corpid, Long formId) {
        paasRedisHelper.removeValue(RedisPrefixConstant.OPPORTUNITY_STAGE,corpid);
        String redisKey = corpid + "_" + formId + "_" + 1;
        paasRedisHelper.removeValue(RedisPrefixConstant.OPPORTUNITY_STAGE,redisKey);
        redisKey = corpid + "_" + formId + "_" + 0;
        paasRedisHelper.removeValue(RedisPrefixConstant.OPPORTUNITY_STAGE,redisKey);
        redisKey = corpid + "_" + formId + "_" + null;
        paasRedisHelper.removeValue(RedisPrefixConstant.OPPORTUNITY_STAGE,redisKey);
    }
}
